home *** CD-ROM | disk | FTP | other *** search
/ Adobe Graphics & Publishing SDK 1996 December / Adobe Graphics & Publishing SDK 1996 December.iso / mac / PageMaker 6.5 SDK Mac / SourceCode / PageMakerClassLibrary / Queries / PListMom.cpp < prev    next >
C/C++ Source or Header  |  1996-08-15  |  937b  |  50 lines

  1. /*
  2.  *--- PListMom.cpp --------------------------------------------------------
  3.  * Copyright (c) 1995-96 Adobe Systems Incorporated.  All rights reserved.
  4.  * Created on Thu, Oct 12, 1995 @ 10:00 PM by Paul Ferguson.
  5.  *
  6.  * Description:  For notes about this class, refer to the
  7.  * PCL documentation file PListMom.html
  8.  *-------------------------------------------------------------------------
  9.  */
  10.  
  11. #include "PListMom.h"
  12.  
  13. PListMom::PListMom()
  14. : numItems(0), itemsPtr(0), curItem(0), curItemPtr(0)
  15. {
  16.  
  17. }
  18.  
  19. PListMom& PListMom::operator=(const char * buf)
  20. {
  21.     itemsPtr = buf;
  22.     numItems = *(short *) itemsPtr;
  23.     itemsPtr += 2;
  24.     
  25.     curItem = 0;
  26.     curItemPtr = itemsPtr;
  27.     
  28.     return *this;
  29. }
  30.  
  31. void  PListMom::Update(const char * ch)
  32. {
  33.     if (++curItem >= numItems)
  34.     {
  35.         Reset();
  36.     }
  37.     else
  38.     {
  39.         curItemPtr = ch;    
  40.     }
  41. }
  42.  
  43. void PListMom::Reset()
  44. {
  45.     curItem = 0;
  46.     curItemPtr = itemsPtr;
  47. }
  48.  
  49. // end of PListMom.cpp
  50.